package com.guomao.demoa;

//Person类 系统类加载器加载到jvm的方法区 并且返回该类型的Class对象 字节码文件对象
public class Person {

    private String name;
    private int age;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public Person() {
    }

    private Person(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    public void work() {
        System.out.println(this.name + "正在努力工作...");
    }

    public void sport(int minutes) {
        System.out.println(this.name + "已经运动了" + minutes + "分钟");
    }

    public void sport(String minutes) {
        System.out.println(this.name + "已经运动了" + minutes + "分钟");
    }

    private void study() {
        System.out.println(this.name + "正在学习...");
    }

    public String showInfo() {
        return this.name;
    }
}
